package com.example.moblie2021606143cwj0408;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity4 extends AppCompatActivity {

    private TextView tvMainTitle4;
    private TextView tvMain2;
    private TextView tvMain3;
    private TextView tvMain4;
    private EditText edi3;
    private Button btn2;
    int china,glmre,output;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main4);
        initView();
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String string = edi3.getText().toString();
                int num1=Integer.valueOf(string).intValue();
                if (num1 == china){
                    output = glmre;
                }
                string=String.valueOf(output);
               tvMain4.setText(output);
            }
        });
    }


    private void initView() {
        tvMainTitle4 = findViewById(R.id.tv_main_title4);
        tvMain2 = findViewById(R.id.tv_main2);
        tvMain3 = findViewById(R.id.tv_main3);
        tvMain4 = findViewById(R.id.tv_main4);
        edi3 = findViewById(R.id.edi3);
        btn2 = findViewById(R.id.btn2);
    }
}